package file;

import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author guoqf
 * @date 2021/9/25 0:54
 */
public class HashSetTest {
    public static void main(String[] args) {
        Set<String> set = new HashSet<>();
        String collect = set.stream().collect(Collectors.joining(","));
        System.out.println("Empty set: " + collect);
        System.out.println("Empty set length: " + collect.length());

        set.add("1");
        set.add("2");
        System.out.println("Full set: " + set.stream().collect(Collectors.joining(",")));

    }
}
